package com.bee.tlweb.service;

import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;

import com.bee.tlweb.model.Message;
import com.bee.tlweb.model.User;

public class UserService {
	
	public User login(String name,String password){
		User user = new User();
		user.setCredit(13768.12);
		user.setGender(User.MAIL);
		user.setName(name);
		Calendar cal =Calendar.getInstance();
		cal.add(Calendar.DAY_OF_MONTH, -5);
		cal.add(Calendar.HOUR, -2);
		user.setLastLoginTime(cal.getTime());
		user.setId(1);
		Message msg1 = new Message();
		Message msg2 = new Message();
		msg1.setContent("有人加你为好友，lucy");
		msg1.setMsgId (1);
		msg1.setUpdateDate(new Date());
		msg1.setUser(user);
		
		msg2.setContent("有人加你为好友,miaojun");
		msg2.setMsgId (2);
		msg2.setUpdateDate(new Date());
		msg2.setUser(user);
		user.setMessages(Arrays.asList(new Message[]{msg1,msg2}));
		return user;
		
	
	}
	
	
}
